<?php
 
if ($args[0] == 0)
{?>

 
 <!DOCTYPE html>
<html style="font-size: 12px;">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
        <meta name="format-detection" content="telephone=no">
        <title>开奖大厅</title>
        <link rel="stylesheet" href="/skin/laofan/newlist.css">
    </head>
    <body ontouchstart="" class="login-bg">
	<div class="header">
    <div class="headerTop">
        <div class="ui-toolbar-left">
            <a id="reveal-left" href="/index.php">reveal</a>
        </div>
        <h1 class="ui-toolbar-title">开奖大厅</h1>
    </div>
</div>
<div class="sub_ScorllCont">
<div class="lott-list">
  <ul id="draw_list">
 <?php
   	$sql="select id,type, title  from ssc_type  ";
	$all_types = $this->getRows($sql); 
 
	foreach($all_types as   $ve){
	$ki = $ve['id'];
 
  	$sql="select type, time, number, data from ssc_data where type={$ki} order by id desc limit 1 ";
	$ssc=$this->getRows($sql);  $var = $ssc[0];
	if(empty($var))continue;  
?> 
<?php  
		if ($var['type'] == 52 || $var['type'] == 50 || $var['type'] == 25) //快3显示
		{ ?>
			<li class="list-k3"><a href="/index.php/index/historyList-1/<?=$ki?>"  >
		  <div class="lott-list-tit"><span><?=$ve['title']?></span><span class="gray" style="font-size: 11px;">第<?=$var['number']?>期  <?=date('H:i', $var['time'])?></span></div>
		  <div class="lott-k3 nums-jsks">
			<div class="k3-number k3-lottery">
			  <ul class="k3-lot">
				<span class="nums">
				<?php 
				$tmp = $var['data'] ;
				$tmp_arr = explode(',',$tmp);
				foreach($tmp_arr as $v){ if(empty($v))continue;
				?>
				<li><img src="/skin/laofan/images/touzi_0<?=$v?>.png"></li>
				<?php } ?>	
 
				</span>
			  </ul>
			</div>
		  </div>
		  </a></li>	
		  <?php }else{ ?>
      <li class="list-k3"><a href="/index.php/index/historyList-1/<?=$ki?>">
        <div class="lott-list-tit">
		<span class="f_span"><?=$ve['title']?></span>
		<span class="gray" style="font-size: 11px;">第<?=$var['number']?>期  <?=date('H:i', $var['time'])?></span>
		</div>
        <div class="two-ball two-lottery nums-open">
		<span class="nums">
		<?php $tmp = $var['data'] ;
			$tmp_arr = explode(',',$tmp);
			foreach($tmp_arr as $v){ if(empty($v))continue;
		?>
			<i><?=$v?></i>
		 <?php } ?>	
		 
		</span>
		</div>
        </a>
		</li>
       <?php }  }  ?>
  </ul>
</div>

</div>
  
    </body>
</html> 
	  
	  
<?php	 exit();
}else{
	$sql="select type, time, number, data from ssc_data where type={$args[0]}";
}
	
	$sql=$sql." order by id desc";
	$data=$this->getPage($sql, $this->page, $this->pageSize);
    $typename=$this->getValue("select title from ssc_type where id=?",$args[0]);
?>
<?php $this->display('inc_skin.php', 0 , '开奖记录'); ?>
<?php $this->display('inc_header.php'); ?>
 <link rel="stylesheet" href="/skin/laofan/newlist.css">
 <style type="text/css">
 .sub_ScorllCont{margin-top: 0px;margin-left: 0px;}
 </style>
<div class="bet-info popupModal ffffddd">
<table width="100%">
	<tbody class="ht-cont">
	<?php if($data['data']) foreach($data['data'] as $var){ ?>
		
		<tr>
			<td><?=$typename?></td>
			<td><?=$var['number']?></td>
			<td><?=$var['data']?></td>
			<td><?=date('H:i', $var['time'])?></td>
		</tr>
	<?php } ?>
	</tbody>
</table>

 
<?php $this->display('inc_page.php',0,$data['total'],$this->pageSize, '/index.php/index/historyList-{page}/'.$args[0]);?>
<?php $this->display('inc_footer.php'); ?> 
</div>